package com.ruoyi.order.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ruoyi.order.domain.app.Vo.UserAddr;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.UserAddressMapper;
import com.ruoyi.order.domain.UserAddress;
import com.ruoyi.order.service.IUserAddressService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户地址Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-08
 */
@Service
public class UserAddressServiceImpl implements IUserAddressService 
{
    @Autowired
    private UserAddressMapper userAddressMapper;

    /**
     * 查询用户地址
     * 
     * @param addressID 用户地址主键
     * @return 用户地址
     */
    @Override
    public UserAddress selectUserAddressByAddressID(Integer addressID)
    {
        return userAddressMapper.selectUserAddressByAddressID(addressID);
    }

    /**
     * 查询用户地址列表
     * 
     * @param userAddress 用户地址
     * @return 用户地址
     */
    @Override
    public List<UserAddress> selectUserAddressList(UserAddress userAddress)
    {
        return userAddressMapper.selectUserAddressList(userAddress);
    }

    /**
     * 新增用户地址
     * 
     * @param userAddress 用户地址
     * @return 结果
     */
    @Override
    public int insertUserAddress(UserAddress userAddress)
    {
        return userAddressMapper.insertUserAddress(userAddress);
    }

    /**
     * 修改用户地址
     * 
     * @param userAddress 用户地址
     * @return 结果
     */
    @Override
    public int updateUserAddress(UserAddress userAddress)
    {
        return userAddressMapper.updateUserAddress(userAddress);
    }

    /**
     * 批量删除用户地址
     * 
     * @param addressIDs 需要删除的用户地址主键
     * @return 结果
     */
    @Override
    public int deleteUserAddressByAddressIDs(String addressIDs)
    {
        return userAddressMapper.deleteUserAddressByAddressIDs(Convert.toStrArray(addressIDs));
    }

    /**
     * 删除用户地址信息
     * 
     * @param addressID 用户地址主键
     * @return 结果
     */
    @Override
    public int deleteUserAddressByAddressID(Integer addressID)
    {
        return userAddressMapper.deleteUserAddressByAddressID(addressID);
    }


}
